using System;
using UnityEngine;

[Serializable]
public class Vector3Range
{
	public Vector3 min;

	public Vector3 max;

	public Vector3 Clamp(Vector3 position)
	{
		position.x = Mathf.Clamp(position.x, min.x, max.x);
		position.y = Mathf.Clamp(position.y, min.y, max.y);
		position.z = Mathf.Clamp(position.z, min.z, max.z);
		return position;
	}

	public Vector3 LerpZeroCenter(float t, Vector3 center)
	{
		if (t < 0f)
		{
			return Vector3.Lerp(center, min, Mathf.Abs(t));
		}
		return Vector3.Lerp(center, max, Mathf.Abs(t));
	}
}
